home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmigaPlus / Tools / Development / RxMUI / Examples / Envbrowser.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2004-01-31  |  2.6 KB  |  93 lines

  1. /* Browse ENV */
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. call Init
  7. call CreateApp
  8. call HandleApp
  9.  
  10. /***********************************************************************/
  11. Init: procedure expose global.
  12.     l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  13.     if AddLibrary("rexxsupport.library","rxmui.library")~=0 then exit
  14.     return
  15. /***********************************************************************/
  16. handleApp: procedure  expose global.
  17.     ctrl_c=2**12
  18.     do forever
  19.         call NewHandle("APP","H",ctrl_c)
  20.         if and(h.signals,ctrl_c)>0 then exit
  21.         select
  22.  
  23.             when h.event="QUIT" then exit
  24.  
  25.             when h.event="PARENT" then do
  26.                 call getattr("dlist","directory","P")
  27.                 call set("dlist","directory",pathpart(p))
  28.             end
  29.  
  30.             when h.event="DOUBLE" then do
  31.                 call getattr("dlist","Path","P")
  32.                 if word(statef(p),1)="DIR" then call set("dlist","directory",p)
  33.             end
  34.  
  35.             when h.event="DISPLAY" then do
  36.                 call getattr("dlist","Path","P")
  37.                 if word(statef(p),1)~="DIR" then cont=ReadFile(p)
  38.                 else cont=""
  39.                 call set("elcont","contents",cont)
  40.             end
  41.  
  42.             otherwise nop
  43.         end
  44.     end
  45.  
  46. /***********************************************************************/
  47. createApp: procedure expose global.
  48.  
  49.     app.title="EnvBrowser"
  50.     app.version="$Ver: EnvBrowser 19.5 (20.7.2000)"
  51.     app.copyright="Copyright 2000 by Alfie"
  52.     app.author="alfie"
  53.     app.description="View environment variables."
  54.     app.base="ENVBROWSER"
  55.     app.SubWindow="mwin"
  56.  
  57.      mwin.ID="MAIN"
  58.      mwin.title="Environment Browser"
  59.      mwin.contents="mgroup"
  60.  
  61.       call child("mgroup","elview","listview")
  62.        elview.list="dlist"
  63.         dlist.class="dirlist"
  64.         dlist.frame="inputlist"
  65.         dlist.directory="env:"
  66.  
  67.       call child("mgroup","elcont","textinputscroll")
  68.        elcont.FIXHEIGHTTXT="0a0a0a0a"x
  69.        elcont.frame="text"
  70.        elcont.multiline=1
  71.        elcont.noinput=1
  72.  
  73.       call child("mgroup",button("parent","_Parent"))
  74.  
  75.     if NewObj("application","app")>0 then exit
  76.  
  77.     call notify("mwin","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
  78.  
  79.     call notify("elview","active","everytime","app","return","DISPLAY")
  80.     call notify("elview","doubleclick","everytime","app","return","DOUBLE")
  81.  
  82.     call notify("parent","pressed",0,"app","returnid")
  83.  
  84.     call set("mwin","open",1)
  85.  
  86.     return
  87. /***********************************************************************/
  88. halt:
  89. break_c:
  90.     exit
  91. /**************************************************************************/
  92.  
  93.